-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Tooling] Add google owned cache for dependencies as an option in ci #4567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Requried to be an authenticated googler `gcloud auth application-default login` Useful links https://g3doc.corp.google.com/company/teams/artifact-hub/index.md?cl=head#maven https://github.com/GoogleCloudPlatform/artifact-registry-maven-tools/blob/master/README.md Useful command ``` gcloud artifacts print-settings mvn \ --project=artifact-foundry-prod \ --repository=maven-3p \ --location=us ```
…epository addition
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
packages/camera/camera_android_camerax/example/android/build.gradle
Outdated
Show resolved
Hide resolved
packages/camera/camera_android_camerax/example/android/build.gradle
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
GRADLE_STRUCTURE.md
Outdated
@@ -0,0 +1,16 @@ | |||
# Gradle Structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having seen the details here, I think a wiki page referenced from https://github.com/flutter/flutter/wiki/Understanding-Packages-tests#external-build-dependencies and maybe https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure would probably be better than an md file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok in that case consider the md files content for review and I will remove and update the wiki before merging.
GRADLE_STRUCTURE.md
Outdated
@@ -0,0 +1,16 @@ | |||
# Gradle Structure | |||
|
|||
`package/example/android/settings.gradle` imports the flutter tooling, includes the app directory, and configures GoogleCloudPlatform/artifact-registry-maven-tools for use in ci. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
GRADLE_STRUCTURE.md
Outdated
|
||
`package/example/android/settings.gradle` imports the flutter tooling, includes the app directory, and configures GoogleCloudPlatform/artifact-registry-maven-tools for use in ci. | ||
|
||
This repo has a GCP instance that mirrors dependencies available from `google()` and `mavenCentral()` used by ci (or googlers). This gives us redundant uptime for dependency availability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits: CI, Googlers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
GRADLE_STRUCTURE.md
Outdated
|
||
Using this cache is not intended or avaiable for contributors outside of CI. We protect that execution with an environment variable `ARTIFACT_HUB_REPOSITORY` to ensure that by default users do not see rejected cloud credentials or errors in builds. | ||
|
||
Googlers can debug locally by setting `ARTIFACT_HUB_REPOSITORY` to the valid artifact hub value and authenticating with GCP. To authenticate run `gcloud auth application-default login`. To find artifact hub url use `<url>` section of go/artifact-hub#maven or inspect the value on CI servers. CI uses a service account for billing. That is defined in go/artifact-hub-service-account (googler access only). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Googler access
@@ -1,3 +1,7 @@ | |||
## NEXT | |||
|
|||
* Updates android example to be able to use custom use artifactregistery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since nobody outside the Flutter team can use this, let's not put it in the CHANGELOG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can if they setup a artifactrepository then setup the env variables on their local machine (I just updated the file to reflect this). I removed the google specific access parts to configuration. Also mechanically there is a new dependency and the changelog thing scolded me.
I can remove this if you want even though there is technically a developer facing change that should not impact the.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed and replaced with https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure
Overriding changelog check: see #4567 (comment) |
Approved by artifact hub team via email by sfelix@ |
Confirmed the environment variable was set correctly https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8773957271362564241/+/u/Run_package_tests/download_Dart_and_Android_deps/execution_details and confirmed the artifact hub variable was used |
https://critique.corp.google.com/cl/552818879 had not landed. Links above show our configuration is correct and that if we lose access to artifact hub our builds will not go red. I do not know of a way to verify we are getting the dependencies from the artifact hub server without ssh access to the machine while they are being downloaded. In a future pr I could make ci only use the artifact hub instance but I am not confident enough yet to make that call. |
flutter/packages@4e4961a...d00c1f9 2023-08-03 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.1 to 2.21.2 (flutter/packages#4637) 2023-08-03 [email protected] Roll Flutter from b3f99ff to c00d241 (12 revisions) (flutter/packages#4640) 2023-08-03 [email protected] [path_provider] Add getApplicationCachePath() - implementations (flutter/packages#4619) 2023-08-03 [email protected] [various] Removed references to deprecated `TestWindow` APIs (flutter/packages#4558) 2023-08-02 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 4.1.0 to 4.3.0 (flutter/packages#4432) 2023-08-02 [email protected] [go_router_builder] Add go_router StatefulShellRoute support to go_router_builder (flutter/packages#4238) 2023-08-02 [email protected] [Tooling] Add google owned cache for dependencies as an option in ci (flutter/packages#4567) 2023-08-02 [email protected] Roll Flutter from 1d59196 to b3f99ff (32 revisions) (flutter/packages#4634) 2023-08-02 [email protected] [go_router_builder] Support `ShellRouteData` without `const` constructor (flutter/packages#4627) 2023-08-02 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.0 to 2.21.1 (flutter/packages#4573) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of #4567
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
Service account setup cl/551888350 See flutter/packages#4567 See https://github.com/flutter/flutter/wiki/Plugins-and-Packages-repository-structure#gradle-structure Bug: flutter/flutter/issues/120119 Change-Id: Ic1c4dd7c348854b21f9dedd02d664edc34e9bcec Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/48260 Commit-Queue: Reid Baker <[email protected]> Reviewed-by: Keyong Han <[email protected]>
- Adds artifact hub check to gradle command - Add tests for build.gradle and settings.gradle check - Update all example build.gradle and settings.gradle files flutter/flutter/issues/120119 Expansion of flutter/packages#4567
Proof of concept of a package using artifact hub.
Artifact hub is a google owned and managed cache of google/maven dependencies.
Using this cache should decrease the number of flakes related to downloading dependencies along with future benefits of licence analysis and security alerts.
Read more at go/artifact-hub#maven
flutter/flutter/issues/120119
Next steps:
Enable a new env variable on CI servers. https://flutter-review.googlesource.com/c/recipes/+/48260 cl/551888350
Merge this PR.
Apply this change to all packages
Add enforcement as part of the gradle check.
Developers have a new dependency for buildscript but it is publicly available, so I added a next changelog.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).